package yxy.game.pm2.module.godBeast;

import yxy.game.pm2.bean.GodBeastEquipPosition;

/**
 * @name GodBeast
 * @author wrs
 * @description 神兽槽
 * @since 2022-05-31
 */
public class GodBeast {

    private int code; //神兽ID
    private String name; //神兽名称
    private int type; //神兽类型
    private int attack;  //攻击
    private int defense; //防御
    private int life; //生命
    private boolean isOpen; //是否解锁
    private boolean isBattle; //是否上阵
    private int level; //神兽等级
    private int maxLevel; //最高等级
    private int[] strengthenLevels = new int[3]; //强化等级集合，爪、魂、环

    private int maxSkillLevel; //最高技能等级
    private int skillLevel; //技能等级，初始值为0
    private GodBeastEquip[] godBeastEquips; //神兽装备

    public int getCode() { return code; }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAttack() {
        return attack;
    }

    public void setAttack(int attack) {
        this.attack = attack;
    }

    public int getDefense() {
        return defense;
    }

    public void setDefense(int defense) {
        this.defense = defense;
    }

    public int getLife() {
        return life;
    }

    public void setLife(int life) {
        this.life = life;
    }

    public boolean isOpen() {
        return isOpen;
    }

    public void setOpen(boolean open) {
        isOpen = open;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public boolean isBattle() {
        return isBattle;
    }

    public void setBattle(boolean battle) {
        isBattle = battle;
    }

    public int getMaxLevel() {
        return maxLevel;
    }

    public void setMaxLevel(int maxLevel) {
        this.maxLevel = maxLevel;
    }

    public int getMaxSkillLevel() {
        return maxSkillLevel;
    }

    public void setMaxSkillLevel(int maxSkillLevel) {
        this.maxSkillLevel = maxSkillLevel;
    }

    public int[] getStrengthenLevels() {
        return strengthenLevels;
    }

    public void setStrengthenLevels(int[] strengthenLevels) {
        this.strengthenLevels = strengthenLevels;
    }

    public int getStrengthenLevel(int position) {
        return getStrengthenLevels()[position];
    }

    public int setStrengthenLevel(int position,int value){
        int val = getStrengthenLevels()[position];
        strengthenLevels[position] = value;
        return val;
    }

    public GodBeastEquip[] getGodBeastEquips() {
        if (godBeastEquips == null || godBeastEquips.length < GodBeastEquipPosition.values().length) {
            godBeastEquips = new GodBeastEquip[GodBeastEquipPosition.values().length];
        }
        return godBeastEquips;
    }

    public GodBeastEquip getGodBeastEquips(GodBeastEquipPosition position){
        return getGodBeastEquips()[position.getNumber()];
    }

    public void setGodBeastEquips(GodBeastEquip[] equipCodes) {
        this.godBeastEquips = equipCodes;
    }

    //返回未修改前穿戴的装备
    public GodBeastEquip setGodBeastEquip(GodBeastEquipPosition position,GodBeastEquip equip) {
        GodBeastEquip result = getGodBeastEquips()[position.getNumber()];
        godBeastEquips[position.getNumber()] = equip;
        return result;
    }

    public int getSkillLevel() {
        return skillLevel;
    }

    public void setSkillLevel(int skillLevel) {
        this.skillLevel = skillLevel;
    }
}
